package com.prothink.controller;

import com.prothink.entity.FenyeNode;
import com.prothink.entity.JsComment;
import com.prothink.service.UserCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @BelongsProject: siyun2
 * @BelongsPackage: com.prothink.controller
 * @Author: Jin
 * @CreateTime: 2022-12-06  19:25
 * @Description: TODO
 */
@Controller
@RequestMapping("/UserComment")
@CrossOrigin
public class UserCommentController {
    @Autowired
    private UserCommentService userCommentService;
    @ResponseBody
    @GetMapping("/getUserComment")
    public FenyeNode<JsComment> getUserComment(JsComment jsComment){
        System.out.println("前端传回的评论用户id"+jsComment);
        FenyeNode<JsComment> userComment = userCommentService.getUserComment(jsComment);
        System.out.println(";;"+userComment);
        return userComment;
    }
}
